<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同编号" :labelCol="labelCol">
              <j-input placeholder="请输入合同编号" v-model="queryParam.finalNo"></j-input>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同名称" :labelCol="labelCol">
              <j-input placeholder="请输入合同名称" v-model="queryParam.htmc"></j-input>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="费用类型" :labelCol="labelCol">
              <j-dict-select-tag type="list" v-model="queryParam.feeType"
                dictCode="fee_type"
                placeholder="请选择费用类型"/>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目编号" :labelCol="labelCol">
              <j-input placeholder="请输入项目编号" v-model="queryParam.xmbh"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目名称"
              :labelCol="{
                xs: { span: 24 },
                sm: { span: 5 },
              }"
              :wrapperCol="{
                xs: { span: 24 },
                sm: { span: 19 },
              }"
            >
              <select-project-input ref="projectModel" v-model="queryParam.xmmc"/>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="业绩归属年度" :labelCol="labelCol">
              <j-dict-select-tag placeholder="请选择业绩归属年度" v-model="queryParam.yjgsnd" dictCode="yjgsnd"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="签订日期" :labelCol="labelCol">
              <a-range-picker
                format="YYYY-MM-DD"
                :placeholder="['开始日期', '结束日期']"
                v-model="qdrqRange"
                @change="(dates, dateStrs) => { queryParam.qdrq_begin = dateStrs[0]; queryParam.qdrq_end = dateStrs[1] }"
                style="width: 100%"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同类型" :labelCol="labelCol">
              <j-dict-select-tag placeholder="请选择合同类型" v-model="queryParam.htlx" dictCode="htlx_type"/>
            </a-form-item>
          </a-col>
          <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="变更状态" :labelCol="labelCol">
              <j-dict-select-tag placeholder="请选择合同类型" v-model="queryParam.changeStatus" dictCode="change_status"/>
            </a-form-item>
          </a-col> -->
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="本次合同额" :labelCol="labelCol">
              <a-input-number
                :precision="0"
                placeholder="请输入最小值"
                class="query-group-cust"
                v-model="queryParam.bchteBegin"
                @change="(val) => this.bchteRange = parseInt(val)"
                style="width: 47%"
                :min="0"
                :max="999999999"/>
              -
              <a-input-number
                :precision="0"
                placeholder="请输入最大值"
                class="query-group-cust"
                v-model="queryParam.bchteEnd"
                style="width: 47%"
                :min="bchteRange"
                :max="999999999"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="签订单位" :labelCol="labelCol">
              <select-Company-input v-model="queryParam.qddw" placeholder="请选择签订单位"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="业主单位" :labelCol="labelCol">
              <select-customer-input v-model="queryParam.yzdw" commercialType="1"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="经营团队" :labelCol="labelCol">
              <select-team-input v-model="queryParam.jytd" :tdlx="1" :teamType="0"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同档案状态" :labelCol="labelCol">
              <j-dict-select-tag placeholder="请选择合同档案状态" v-model="queryParam.status" dictCode="contract_final_status"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目档案状态" :labelCol="labelCol">
              <j-dict-select-tag placeholder="请选择项目档案状态" v-model="queryParam.currentProjectStatus" dictCode="current_project_status"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-model-item label="业务分类" :labelCol="labelCol">
              <business-category-name-select v-model="queryParam.businessCategoryName" @back="businessCategoryHandle"/>
            </a-form-model-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="申请人" :labelCol="labelCol">
              <j-select-user-by-dep :multi="false" v-model="queryParam.createBy"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="申请部门" :labelCol="labelCol">
              <j-select-depart v-model="queryParam.sysOrgCode" :trigger-change="true" customReturnField="orgCode" ></j-select-depart>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目地点" :labelCol="labelCol">
              <AddressChoice  type="cascader" v-model="queryParam.areaCode" placeholder="请输入省市区"/>
            </a-form-item>
          </a-col>
          <!-- <template v-if="toggleSearchStatus">
          </template> -->
          <a-col style="float: left;overflow: hidden;" :xl="6" :lg="7" :md="8" :sm="24">
            <span class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button @click="handleReset" icon="reload" style="margin-left: 8px;">重置</a-button>
              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a> -->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('项目合同台账一览表')">导出
      </a-button>
<!--      <a-popover title="自定义列" trigger="click" placement="leftBottom" style="margin-bottom: 10px">-->
<!--        <template slot="content">-->
<!--          <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">-->
<!--            <a-row>-->
<!--              <template v-for="(item,index) in defColumns">-->
<!--                <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">-->
<!--                  <a-col :span="12">-->
<!--                    <a-checkbox :value="item.dataIndex">-->
<!--                      &lt;!&ndash; {{ item.title }} &ndash;&gt;-->
<!--                      <ellipsis :length="9">{{item.title}}</ellipsis>-->
<!--                      </a-checkbox>-->
<!--                  </a-col>-->
<!--                </template>-->
<!--              </template>-->
<!--            </a-row>-->
<!--          </a-checkbox-group>-->
<!--        </template>-->
<!--        <a style="float: right;">-->
<!--          <a-icon type="setting" :style="iconStyle"/>-->
<!--        </a>-->
<!--      </a-popover>-->
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :components="draggableComponent"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="false"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        :loading="loading"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @change="tableChangePages">
        <a slot="xmmc" slot-scope="text, record" @click="onDetail(record.xmmc)">{{ text }}</a>
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>
        <a slot="htmc" :title="text" slot-scope="text, record" @click="getDetail(record.id)">
          {{ text }}
          <!-- <ellipsis :length="9">{{text}}</ellipsis> -->
          <!-- <j-ellipsis :value="text" :length="15"/> -->
          </a>
      </a-table>
    </div>
    <div style="padding: 10px; display: flex; justify-content: flex-end;" v-if="rowSpanPagination.totalPage">
      <Pagination :total-page="rowSpanPagination.totalPage" :current-page="rowSpanPagination.pageNo" :visiblePages="10" :total="rowSpanPagination.total" @page-change="handlePageChange" />
    </div>
    <erp-omc-contract-manager-final-modal ref="modalForm" @ok="modalFormOk"></erp-omc-contract-manager-final-modal>
    <!-- 项目详情开始 -->
    <erp-project-report-modal  ref="projectModalForm"></erp-project-report-modal>
    <!-- 项目详情结束 -->
  </a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ErpOmcContractManagerFinalModal from './modules/ErpOmcContractManagerFinalModal'
import { DisabledAuthFilterMixin } from '@/mixins/DisabledAuthFilterMixin'
import SelectCustomerInput from '@/views/scy/components/SelectCustomerInput'
import SelectTeamInput from '@/views/scy/components/SelectTeamInput'
import SelectProjectInput from '@/views/scy/components/SelectProjectInput'
import SelectUserByDep from '@/views/scy/components/SelectUserByDep'
import BusinessCategoryNameSelect from '@views/erp/components/BusinessCategoryNameSelect'
import SelectCompanyInput from '@/views/scy/components/SelectCompanyInput'
import Ellipsis from '@/components/Ellipsis'
import {getAction} from '@/api/manage'
import ErpProjectReportModal from '@/views/erp/report/project/modules/ErpProjectReportModal'
import AddressChoice from '@/components/AddressChoice/AddressChoice';
import Pagination from '@/views/erp/report/audit/Pagination'
export default {
  name: 'ErpOmcContractManagerFinalList',
  mixins: [JeecgListMixin, mixinDevice, DisabledAuthFilterMixin],
  components: {
    ErpOmcContractManagerFinalModal,
    SelectCustomerInput,
    SelectTeamInput,
    SelectProjectInput,
    SelectUserByDep,
    BusinessCategoryNameSelect,
    SelectCompanyInput,
    Ellipsis,
    ErpProjectReportModal,
    AddressChoice,
    Pagination
  },
  data() {
    return {
      rowSpanPagination: {
        pageNo: 1,
        pageSize: 5,
        totalPage: 0,
        total: 0
      },
      /* 排序参数 */
      isorter: {
        column: '',
        order: ''
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      description: '合同档案管理管理页面',
      // 表头
      columns: [],
      // 列设置
      settingColumns: [],
      // 列定义
      defColumns: [
        // {
        //   title: '序号',
        //   align: 'center',
        //   dataIndex: '',
        //   key: 'rowIndex',
        //   // fixed: 'left',
        //   width: 60,
        //   ellipsis: true,
        //   customRender: (value, row, index) => {
        //     const obj = {
        //       children: value,
        //       attrs: {}
        //     };
        //     const obj1 = this.customRow(row, index);
        //     obj.attrs.rowSpan = obj1.rowspan
        //     return obj;
        //   },
        //   customRender: function (t, r, index) {
        //     return parseInt(index) + 1;
        //   },
        // },
        {
          title: '合同编号',
          align: 'center',
          dataIndex: 'finalNo',
          // fixed: 'left',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '合同名称',
          align: 'center',
          dataIndex: 'htmc',
          // fixed: 'left',
          ellipsis: true,
          width: 226,
          scopedSlots: { customRender: 'htmc' },
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '费用类型',
          align: 'center',
          dataIndex: 'feeType_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '项目编号',
          align: 'center',
          dataIndex: 'xmbh',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '项目名称',
          align: 'center',
          dataIndex: 'xmmc_dictText',
          scopedSlots: { customRender: 'xmmc' },
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '业绩归属年度',
          align: 'center',
          dataIndex: 'yjgsnd_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '签订日期',
          align: 'center',
          dataIndex: 'qdrq',
          ellipsis: true,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '项目地点',
          align: 'center',
          dataIndex: 'relProjectAddress',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '业务板块',
          dataIndex:"ywmcName",
          children: [
            {
              title: '板块名称',
              align: 'center',
              dataIndex: 'firstYwmc',
              ellipsis: true,
              width: 226,
              customRender: (value, row, index) => {
                const obj = {
                  children: value,
                  attrs: {}
                };
                const obj1 = this.customTaskRow(row, index);
                obj.attrs.rowSpan = obj1.rowspan
                return obj;
              }
            },
            {
              title: '业务名称',
              align: 'center',
              dataIndex: 'ywmc',
              ellipsis: true,
              width: 226,
              customRender: (value, row, index) => {
                const obj = {
                  children: value,
                  attrs: {}
                };
                const obj1 = this.customTaskRow(row, index);
                obj.attrs.rowSpan = obj1.rowspan
                return obj;
              }
            }
          ]
        },
        {
          title: '合同类型',
          align: 'center',
          dataIndex: 'htlx_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '本次合同额(元)',
          align: 'center',
          dataIndex: 'bchte',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '服务期限',
          align: 'center',
          dataIndex: 'servicePeriod',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '履约保证金(元)',
          align: 'center',
          dataIndex: 'bail',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '合同存档份数',
          align: 'center',
          dataIndex: 'cdfs',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '签订单位',
          align: 'center',
          dataIndex: 'qddw_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '业主单位',
          align: 'center',
          dataIndex: 'yzdw_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '经营团队',
          align: 'center',
          dataIndex: 'jytd_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '申请人',
          align: 'center',
          dataIndex: 'createBy_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '申请部门',
          align: 'center',
          dataIndex: 'sysOrgCode_dictText',
          ellipsis: true,
          width: 226,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        // {
        //   title: '变更状态',
        //   align: 'center',
        //   dataIndex: 'changeStatus_dictText',
        //   ellipsis: true,
        //   width: 226,
        //   customRender: (value, row, index) => {
        //     const obj = {
        //       children: value,
        //       attrs: {}
        //     };
        //     const obj1 = this.customRow(row, index);
        //     obj.attrs.rowSpan = obj1.rowspan
        //     return obj;
        //   }
        // },
        {
          title: '项目档案状态',
          align: 'center',
          dataIndex: 'currentProjectStatus_dictText',
          ellipsis: true,
          width: 226,
          scopedSlots: { customRender: 'currentProjectStatus' },
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        },
        {
          title: '合同档案状态',
          align: 'center',
          dataIndex: 'status_dictText',
          ellipsis: true,
          width: 226,
          scopedSlots: { customRender: 'status' },
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {}
            };
            const obj1 = this.customRow(row, index);
            obj.attrs.rowSpan = obj1.rowspan
            return obj;
          }
        }
        
      ],
      url: {
        list: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/queryReportPageList',
        // delete: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/delete',
        // deleteBatch: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/deleteBatch',
        exportXlsUrl: '/api/erp/omc/contractmanager/erpOmcContractManagerFinal/exporReporttXls',
        // importExcelUrl: 'api/erp/omc/contractmanager/erpOmcContractManagerFinal/importExcel',
        queryProjectById: '/api/erp/project/report/erpProjectReport/queryById'
      },
      dictOptions: {},
      superFieldList: [],
      qdrqRange: [],
      bchteRange: 0
    }
  },
  created() {
    this.getSuperFieldList();
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {
    getDetail(id) {
      this.$router.push({
        path: `/erp/omc/contractmanager/ErpOmcContractManagerFinalListDetail/${id}`,
      })
    },
    tableChangePages(pagination, filters, sorter){

      this.rowSpanPagination = pagination
      this.rowSpanPagination.pageNo = pagination.current
      this.loadData()
    },
    handlePageChange(pageNo) {
      this.rowSpanPagination.pageNo = pageNo
      this.loadData()
    },

    async loadData(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
      }
      //加载数据 若传入参数1则加载第一页的内容
      if (arg === 1) {
        this.rowSpanPagination.pageNo = 1;
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true
      this.dataSource = []
      let res = await getAction(this.url.list, {
        ...params,
        pageNo: this.rowSpanPagination.pageNo
      })
      this.loading = false

      if (res.success) {
        this.dataSource =  res.result ? res.result.records : [];
        this.rowSpanPagination.totalPage = res.result? res.result.pages : 0
        this.rowSpanPagination.total = res.result? res.result.total : 0
      } else {
        this.dataSource = []
      }
      // this.bizCount();
    },

    // 合并同类项
    customRow(record, index) {
      const rowSpan = this.getRowSpan(record.id, index, 'id', record.taskSize)
      return {
        rowspan: rowSpan
      }
    },
    customTaskRow(record, index) {
      const rowSpan = this.getRowSpan(record.xmmc, index, 'xmmc',  1)
      return {
        rowspan: rowSpan
      }
    },
    getRowSpan(value, index, column, size) {
      if (size === 1 || size === null || size === undefined) {
        return 1
      } else {
        if (index === 0) {
          return size
        }
        // 对比下一个是否存在且相等，如果相等则合并单元格。
        for (let i = index - 1; i >= 0; i--) {
            if (this.dataSource[i][column] === value) {
            size = 0
            break
          }
        }
      }
      return size
    },
    onDetail(id) {
      const that = this
      this.$nextTick(() => {
        getAction(this.url.queryProjectById, { id }).then((res) => {
          if (res.success) {
            const model = res.result
            that.$refs.projectModalForm.getDetail(model);
            that.$refs.projectModalForm.title = '项目一览表';
          }
        })
      })
    },
    getSuperFieldList() {
      let fieldList = [];
      fieldList.push({ type: 'string', value: 'handlerId', text: '经办人编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'handlerDeptId', text: '经办人部门ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'handlerDeptCode', text: '经办人部门编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'delFlag', text: '是否已删除', dictCode: '' })
      fieldList.push({ type: 'string', value: 'htbh', text: '合同编号', dictCode: '' })
      fieldList.push({ type: 'int', value: 'htlx', text: '合同类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'jytd', text: '经营团队', dictCode: '' })
      fieldList.push({ type: 'string', value: 'htmc', text: '合同名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xmmc', text: '项目名称', dictCode: '' })
      fieldList.push({ type: 'int', value: 'sfyz', text: '是否用印', dictCode: '' })
      fieldList.push({ type: 'string', value: 'yzdw', text: '业主单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'qddw', text: '签订单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'yzlx', text: '印章类型', dictCode: '' })
      fieldList.push({ type: 'int', value: 'yyfs', text: '用印份数', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xmcjr', text: '项目承接人', dictCode: '' })
      fieldList.push({ type: 'int', value: 'glskht', text: '关联收款合同', dictCode: '' })
      fieldList.push({ type: 'date', value: 'qdrq', text: '签订日期' })
      fieldList.push({ type: 'string', value: 'lxr', text: '联系人', dictCode: '' })
      fieldList.push({ type: 'string', value: 'lxfs', text: '联系方式', dictCode: '' })
      fieldList.push({ type: 'int', value: 'yjgsnd', text: '业绩归属年度', dictCode: '' })
      fieldList.push({ type: 'int', value: 'skhte', text: '收款合同额', dictCode: '' })
      fieldList.push({ type: 'date', value: 'fwqx', text: '服务期限' })
      fieldList.push({ type: 'string', value: 'yf', text: '乙方', dictCode: '' })
      fieldList.push({ type: 'string', value: 'bchtedx', text: '本次合同额大写', dictCode: '' })
      fieldList.push({ type: 'string', value: 'skhtedx', text: '收款合同额大写', dictCode: '' })
      fieldList.push({ type: 'string', value: 'skhtmc', text: '收款合同名称', dictCode: '' })
      fieldList.push({ type: 'int', value: 'bchte', text: '本次合同额', dictCode: '' })
      fieldList.push({ type: 'string', value: 'jf', text: '甲方', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xmbh', text: '项目编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'status', text: '状态', dictCode: '' })
      fieldList.push({ type: 'int', value: 'lx', text: 'lx', dictCode: '' })
      fieldList.push({ type: 'string', value: 'bz', text: 'bz', dictCode: '' })
      fieldList.push({ type: 'string', value: 'yjxx', text: 'yjxx', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xgfj', text: 'xgfj', dictCode: '' })
      this.superFieldList = fieldList
    },
    handleReset() {
      this.qdrqRange = [];
      this.searchReset();
    },
    businessCategoryHandle(obj) {
      if (obj) {
        this.queryParam.businessCategory = obj.categoryCode;
      }
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
